package com.yupi.picturebackend.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yupi.picturebackend.model.entity.Picture;
import com.yupi.picturebackend.model.entity.PictureFavour;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yupi.picturebackend.model.entity.User;
import org.springframework.transaction.annotation.Transactional;

/**
* @author 伍立权
* @description 针对表【picture_favour(图片收藏)】的数据库操作Service
* @createDate 2025-04-20 17:06:01
*/
public interface PictureFavourService extends IService<PictureFavour> {
    /**
     * 收藏/取消收藏
     * @param pictureId
     * @param loginUser
     * @return
     */
    int doPictureFavour(long pictureId, User loginUser);

    /**
     * 分页获取用户收藏的图片
     * @param page
     * @param queryWrapper
     * @param favourUserId
     * @return
     */
    Page<Picture> listFavourPictureByPage(IPage<Picture> page, Wrapper<Picture> queryWrapper,
                                          long favourUserId);

    /**
     * 收藏图片
     * @param userId
     * @param postId
     * @return
     */
    int doPictureFavourInner(long userId, long postId);
}
